﻿using System;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;

namespace Hxsoft.AppV1.Admin.Controls
{
	public partial class OwnedSiteSelector : BaseUserControl
	{
		#region property
		/// <summary>
		/// 值
		/// </summary>
		public string Value
		{
			get
			{
				return Hxsoft.AppV1.Module.Sites.BuildOwnedSiteIds(Selector.SelectedItems);
			}
			set
			{
				Selector.SelectedItems.Clear();
				Selector.SelectedItems.AddRange(Hxsoft.AppV1.Module.Sites.DecompoundOwnedSiteIds(value));
			}
		}

		/// <summary>
		/// 筛选要显示的站点
		/// </summary>
		public int[] SiteIds
		{
			get { return Selector.SiteIds; }
			set { Selector.SiteIds = value; }
		}
		#endregion

		protected void Page_Load(object sender, EventArgs e)
		{
			if (!IsPostBack)
				this.DataBind();
		}

		protected void ExpandButton_Click(object sender, EventArgs e)
		{
			Selector.Visible = !Selector.Visible;
		}
	}
}